package code;

// 员工类
class Employee {
    String name; // 姓名
    int id;      // 工号
    double salary; // 工资

    public Employee(String name, int id, double salary) {
        this.name = name;
        this.id = id;
        this.salary = salary;
    }

    // 工作方法
    public void work() {
        System.out.println("员工 " + name + " 正在工作");
    }
}

// 项目经理类
class Manager extends Employee {
    double bonus; // 奖金

    public Manager(String name, int id, double salary, double bonus) {
        super(name, id, salary);
        this.bonus = bonus;
    }


    @Override
    public void work() {
        System.out.println("项目经理 " + name + " 正在会见客户,他的奖金是"+this.bonus);
    }
}

// 程序员类
class Coder extends Employee {

    private final double bonus;

    public Coder(String name, int id, double salary, double bonus) {
        super(name, id, salary);
        this.bonus=bonus;
    }

    @Override
    public void work() {
        System.out.println("程序员 " + name + " 正在编写代码,"+"他的奖金是"+bonus);
    }
}
public class TestCode {
    public static void main(String[] args) {
        Coder coder = new Coder("张三", 32542, 5000, 1200);
        Manager manager = new Manager("李四",32541,10000.0,1200);
        coder.work();
        manager.work();
    }
}